﻿using System;
using System.IO;
using System.Windows.Forms;
using Jint;

namespace PawnMaker
{
    public partial class Editor : Form
    {
        public JintEngine Engine;

        public Editor(JintEngine engine)
        {
            Engine = engine;
            InitializeComponent();
        }
        
        private void Editor_Load(object sender, EventArgs e)
        {
            propertyGrid.PropertySort = PropertySort.NoSort;
            Engine.SetParameter("Editor", this);
            try
            {
                Engine.Run(File.ReadAllText("./PawnMaker/PawnMaker.js"));
            }
            catch(Exception exception)
            {
                Console.WriteLine(exception.ToString());
            }
        }
    }
}
